import expansion.ExtConfig;
import expansion.applicationListener.MyEvent;
import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class T09_IOCExt {

    @Test
    public void event() {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(ExtConfig.class);
        //发布事件
        applicationContext.publishEvent(new MyEvent("我发布的事件"));
        applicationContext.close();
    }
}